-
Notifications
You must be signed in to change notification settings - Fork 68
chore(submit_package): use unwrap_or_default instead of .unwrap()
#159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(submit_package): use unwrap_or_default instead of .unwrap()
#159
Conversation
- use `unwrap_or_default()` instead of `.unwrap()`, ideally it should return a specific error variant, it'd be a breaking change though and can be added in a follow-up. - it's only possible to use the internal `minreq::Error` to wrap the `serde_json::Error`, but not the `reqwest::Error` as it does not have public constructors.
Pull Request Test Coverage Report for Build 20804402127Details
💛 - Coveralls |
|
Agree, we should go with the first approach and then create proper error variants once |
luisschwab
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK c2c5485
|
I found 2 more instances of |
|
I think this PR only intends to address those added in the submit package PR, but these can be tackled here as well. |
|
Yes, I only had bookmarked the ones added in the |
luisschwab
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK ea9b5d1
ValuedMammal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK ea9b5d1
Description
unwrap_or_default()instead of.unwrap(), ideally it should return a specific error variant, it'd be a breaking change though and can be added in a follow-up.minreq::Errorto wrap theserde_json::Error, but not thereqwest::Erroras it does not have public constructors.Notes to the reviewers
I personally wanted to remove the
.unwrap()and properly handle the error, though the options I had in mind:SerdeJsonvariant is a breaking change; we can do it as a follow-up for 0.13.0.unwrap_or_default()on both for now.